<template>
  <div class="grand-child">
    <h2>我是GrandChild组件</h2>
    <h3>我喝{{milk}}长大的</h3>
    <button @click="handleClick">把我的牛奶给Child2</button>
  </div>
</template>

<script>
  export default {
    name:'GrandChild',
    data() {
      return {
        milk:'伊利'
      }
    },
    methods: {
      handleClick(){
        // 触发$bus的事件 —— 提供数据的组件干这事
        this.$bus.$emit('send-milk',this.milk)
      }
    },
  }
</script>

<style scoped>
  .grand-child {
    background-color: orange;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px;
  }
</style>